#ifndef GAME_H
#define GAME_H

#include "Singleton.h"
#include "EventHandler.h"
#include "GameObject.h"

#include <map>

class IGraphicsRenderer;

class Game : public EventHandler
{
public:

	typedef std::map<int, GameObject*> GameObjects;

	~Game() {}

	bool Init();
	void Update(float gameSpeed);
	void Draw(IGraphicsRenderer* renderer);

	const GameObjects& GetGameObjects() { return m_gameObjects; }

	int GetNextGameObjectID() { return m_nextGameObjectID; }
	void IncrementGameObjectID() { m_nextGameObjectID++; }
	void AddGameObject(GameObject* pGO);

private:

	Game();
	friend class Singleton<Game>;

	int m_nextGameObjectID;
	GameObjects m_gameObjects;
};

typedef Singleton<Game> TheGame;

#endif